Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

316
Vistas
What's the proper value for "guard" and "middleware" in config/fortify.php file for a SPA?

I am building a single page application (SPA), I have followed the Laravel official document to use Fortify with Sanctum.

From the "SPA Authentication" section on sanctum page (https://laravel.com/docs/8.x/sanctum)

For a SAP, I need to use 'web' for "guard" attribute, but it didn't mention what is the proper value for "middleware" attribute?

And because it instructs you to add \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class to the api middleware group within app/Http/Kernel.php file.

So I assume I should use ['api'] for the middleware? What is the proper value for a SPA?

over 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda